---
layout: single
elementName: dialog
---

<section id="dialog" class="element element--experimental">
  <header class="element-header">
    <nav class="element-links">
        <span>
          Type: <strong>block</strong>
        </span>
      <span>
        Self-closing:
        <strong>
            No
        </strong>
      </span>
      <a class="element-links-direct" href="{{site.url}}/element/dialog/" data-element-name="dialog" data-tooltip="Single page for this element">Permalink</a>
      <a class="element-share" data-tooltip="Share on Twitter or Facebook" data-element-name="dialog">Share</a>
        <a target="_blank" href="https://caniuse.com/#feat=dialog" data-tooltip="See on Can I use…" rel="external">Can I use</a>
      <a target="_blank" href="https://developer.mozilla.org/en/docs/Web/HTML/Element/dialog" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
    </nav>
    <h2 class="element-name">
      <a href="#dialog">
        <span>#</span>
        dialog
      </a>
        <span class="tag tag--experimental">Experimental</span>
    </h2>
    <div class="element-description">
      <p>Defines a <strong>dialog box</strong> that can be opened and closed with JavaScript.</p>

    </div>
  </header>

      <div id="dialog-example-0" class="example">
        <p class="example-label">
          <strong>Example:</strong>
          <a class="example-clipboard" data-tooltip="Click to copy code" data-clipboard-target="#dialog-example-0-code">Copy</a>
        </p>
        <article class="example-preview">
            <div class="example-output"><dialog>
  This is a dialog box!
</dialog></div>
          <div id="dialog-example-0-code" class="example-code">{% highlight html %}<dialog>
  This is a dialog box!
</dialog>{% endhighlight %}</div>
        </article>
      </div>

    <article id="dialog-open" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="open">
            open
          </code>
        </h3>
        <div class="attribute-description">
          <p>Opens the dialog box by default.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="dialog-open-undefined" class="value">
            <header class="value-header">
              <div class="value-description">

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><dialog  open>This is a dialog box!</dialog></div>
            </aside>
          </article>
      </div>
    </article>
</section>
